package itcast.web.servlet;

import itcast.service.Drom_manageService;
import itcast.service.LackService;
import itcast.service.impl.Drom_manageServiceImpl;
import itcast.service.impl.LackServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/dellack_dromServlet")
public class Dellack_dromServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //1.获取id
        String id=request.getParameter("id");
        //2.调用Service删除
        LackService service=new LackServiceImpl();
        service.deleteLack_drom(id);
        //3.跳转到查询所有的Servlet
        response.sendRedirect(request.getContextPath()+"/lackServlet");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request,response);
    }
}
